<script setup lang="ts">
import Teacher from "@/views/dashboard/components/teacher/teacher.vue";
import Student from "@/views/dashboard/components/student/student.vue";
import { useUserStore } from "@/store/modules/user";
import { RoleEnum } from "@/enums/RoleEnum";

// -------组件变量--------
const showContent = ref(true); //内容展示控制
const user = useUserStore();

// -------组件控制--------
onMounted(() => {
  showContent.value = user.user.roles.includes(RoleEnum.STUDENT);
});
</script>

<template>
  <div v-if="showContent">
    <Student />
  </div>
  <div v-else>
    <Teacher />
  </div>
</template>

<style scoped lang="scss"></style>
